/*
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
 *
 * Copyright (c) 2013-2014 sagyf Yang. The Four Group.
 */

package app.events;

import app.kits.JobEhcacheKit;
import app.kits.ParkingNavKit;
import app.models.sys.SmsCategory;
import com.github.sog.initalizer.AppLoadEvent;
import com.github.sog.render.ftl.shiro.ShiroTags;
import com.jfinal.render.FreeMarkerRender;
import freemarker.template.Configuration;

/**
 * <p>
 * 系统启动运行事件.
 * </p>
 *
 * @author sagyf yang
 * @version 1.0 2014-04-10 23:22
 * @since JDK 1.6
 */

public class StartEvent implements AppLoadEvent {
    @Override
    public void load() {
        final Configuration config = FreeMarkerRender.getConfiguration();
        config.setSharedVariable("shiro", new ShiroTags());

        // init parking
        ParkingNavKit.init();
        //
        JobEhcacheKit.init();

        // init event bus context;
        EventBusContext.init();
        // init sms category
        SmsCategory.dao.initCache();
    }
}
